import { createBrowserRouter,Navigate } from "react-router-dom";
import LayoutMain from "../components/layout/layout-main";
import HomeIndex from "../views/home/home-index";
import UserIndex from "../views/user/user-index";
import SettingIndex from "../views/setting/setting-index";
// import ErrorPage from "../views/common/error-page";
import pageOne from "../views/other/pageOne";
import pageTwo from "../views/other/pageTwo";



const Routes = [
    {
        path:"/",
        Component:LayoutMain,
        children:[
            {
                path:"/",
                element: <Navigate to="home" replace></Navigate>,
                // errorElement: <ErrorPage />
            },
            {
                path:"home",
                Component:HomeIndex,
            },
            {
                path:"set",
                Component:SettingIndex,
            },
            {
                path:"user",
                Component:UserIndex,
            },
            {
                path:"other",
                children:[
                    {
                        path:"pageOne",
                        Component:pageOne
                    },
                    {
                        path:"pageTwo",
                        Component:pageTwo
                    }
                ]
            },
        ]
    }
]

export default createBrowserRouter(Routes)